<?php
class Filters extends Controller {

	function Filters()
	{
		parent::Controller();
		$this->load->model('filters_model');
	}

	function index()
	{
		//Create New list
		$list = '';
		
		//RAW Data
		
		$raw_result = $this->filters_model->get_table_field('rawdata');

			
		foreach ($raw_result as $row){
		  $list .=  '<option value="'.$row->type.'" class="rawdata">'.$row->name.'</option>';
	
		}
		
		//KPI
		$raw_result = $this->filters_model->get_all_data('KPI');
		foreach ($raw_result->result() as $row){
		  $list .=  '<option value="'.$row->KPI_FORMULA.'" class="kpi">'.$row->KPI_NAME.'</option>';
	
		}

		//Insert Data in Array
		$data['rawdata'] = $list;
		
		//Render web pagw
		$this->load->view('filter/panel',$data);
	}
	
	function dom()
	{
		$this->load->view('dom.php');
	}
}
?>